#coding:utf-8
import requests
import lxml
from bs4 import BeautifulSoup

url_1 = "http://job.myclub2.com/Home/ArticleList?ps=20&label=15&p=1"
res = requests.get(url_1)
read = res.text
html = BeautifulSoup(read,"lxml")


table = html.find_all("div")[4].find("div").find_all("div")[1]

trs  =list(table.find_all("tr"))

https = []
for i in range(1,len(trs)):
    try:

        tr2 = trs[i]
        tds = tr2.find_all("td")
        link = tds[1].find("a")["href"]
        http = "http://job.myclub2.com"+str(link)
        https.append(http)
    except IndexError as e:
        print(e)

with open("url.txt","w") as f:
    for i in https:
        f.write(i+"\n")


with open("url.txt","r") as file:
    a = file.readlines()
for i in a:
    print(i.strip("\n"))  #去掉前端个末尾的换行符